\(\int \text {sech}(c+d x) (a+b \tanh ^2(c+d x))^2 \, dx\) [93]

   Optimal result
   Rubi [A] (verified)
   Mathematica [C] (warning: unable to verify)
   Maple [A] (verified)
   Fricas [B] (verification not implemented)
   Sympy [F]
   Maxima [B] (verification not implemented)
   Giac [A] (verification not implemented)
   Mupad [B] (verification not implemented)

Optimal result

Integrand size = 21, antiderivative size = 91 \[ \int \text {sech}(c+d x) \left (a+b \tanh ^2(c+d x)\right )^2 \, dx=\frac {\left (8 a^2+8 a b+3 b^2\right ) \arctan (\sinh (c+d x))}{8 d}-\frac {3 b (2 a+b) \text {sech}(c+d x) \tanh (c+d x)}{8 d}-\frac {b \text {sech}^3(c+d x) \left (a+(a+b) \sinh ^2(c+d x)\right ) \tanh (c+d x)}{4 d} \]

[Out]

1/8*(8*a^2+8*a*b+3*b^2)*arctan(sinh(d*x+c))/d-3/8*b*(2*a+b)*sech(d*x+c)*tanh(d*x+c)/d-1/4*b*sech(d*x+c)^3*(a+(
a+b)*sinh(d*x+c)^2)*tanh(d*x+c)/d

Rubi [A] (verified)

Time = 0.07 (sec) , antiderivative size = 91, normalized size of antiderivative = 1.00, number of steps used = 4, number of rules used = 4, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.190, Rules used = {3757, 424, 393, 209} \[ \int \text {sech}(c+d x) \left (a+b \tanh ^2(c+d x)\right )^2 \, dx=\frac {\left (8 a^2+8 a b+3 b^2\right ) \arctan (\sinh (c+d x))}{8 d}-\frac {3 b (2 a+b) \tanh (c+d x) \text {sech}(c+d x)}{8 d}-\frac {b \tanh (c+d x) \text {sech}^3(c+d x) \left ((a+b) \sinh ^2(c+d x)+a\right )}{4 d} \]

[In]

Int[Sech[c + d*x]*(a + b*Tanh[c + d*x]^2)^2,x]

[Out]

((8*a^2 + 8*a*b + 3*b^2)*ArcTan[Sinh[c + d*x]])/(8*d) - (3*b*(2*a + b)*Sech[c + d*x]*Tanh[c + d*x])/(8*d) - (b
*Sech[c + d*x]^3*(a + (a + b)*Sinh[c + d*x]^2)*Tanh[c + d*x])/(4*d)

Rule 209

Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(1/(Rt[a, 2]*Rt[b, 2]))*ArcTan[Rt[b, 2]*(x/Rt[a, 2])], x] /;
 FreeQ[{a, b}, x] && PosQ[a/b] && (GtQ[a, 0] || GtQ[b, 0])

Rule 393

Int[((a_) + (b_.)*(x_)^(n_))^(p_)*((c_) + (d_.)*(x_)^(n_)), x_Symbol] :> Simp[(-(b*c - a*d))*x*((a + b*x^n)^(p
 + 1)/(a*b*n*(p + 1))), x] - Dist[(a*d - b*c*(n*(p + 1) + 1))/(a*b*n*(p + 1)), Int[(a + b*x^n)^(p + 1), x], x]
 /; FreeQ[{a, b, c, d, n, p}, x] && NeQ[b*c - a*d, 0] && (LtQ[p, -1] || ILtQ[1/n + p, 0])

Rule 424

Int[((a_) + (b_.)*(x_)^(n_))^(p_)*((c_) + (d_.)*(x_)^(n_))^(q_), x_Symbol] :> Simp[(a*d - c*b)*x*(a + b*x^n)^(
p + 1)*((c + d*x^n)^(q - 1)/(a*b*n*(p + 1))), x] - Dist[1/(a*b*n*(p + 1)), Int[(a + b*x^n)^(p + 1)*(c + d*x^n)
^(q - 2)*Simp[c*(a*d - c*b*(n*(p + 1) + 1)) + d*(a*d*(n*(q - 1) + 1) - b*c*(n*(p + q) + 1))*x^n, x], x], x] /;
 FreeQ[{a, b, c, d, n}, x] && NeQ[b*c - a*d, 0] && LtQ[p, -1] && GtQ[q, 1] && IntBinomialQ[a, b, c, d, n, p, q
, x]

Rule 3757

Int[sec[(e_.) + (f_.)*(x_)]^(m_.)*((a_) + (b_.)*tan[(e_.) + (f_.)*(x_)]^(n_))^(p_.), x_Symbol] :> With[{ff = F
reeFactors[Sin[e + f*x], x]}, Dist[ff/f, Subst[Int[ExpandToSum[b*(ff*x)^n + a*(1 - ff^2*x^2)^(n/2), x]^p/(1 -
ff^2*x^2)^((m + n*p + 1)/2), x], x, Sin[e + f*x]/ff], x]] /; FreeQ[{a, b, e, f}, x] && IntegerQ[(m - 1)/2] &&
IntegerQ[n/2] && IntegerQ[p]

Rubi steps \begin{align*} \text {integral}& = \frac {\text {Subst}\left (\int \frac {\left (a+(a+b) x^2\right )^2}{\left (1+x^2\right )^3} \, dx,x,\sinh (c+d x)\right )}{d} \\ & = -\frac {b \text {sech}^3(c+d x) \left (a+(a+b) \sinh ^2(c+d x)\right ) \tanh (c+d x)}{4 d}+\frac {\text {Subst}\left (\int \frac {a (4 a+b)+(a+b) (4 a+3 b) x^2}{\left (1+x^2\right )^2} \, dx,x,\sinh (c+d x)\right )}{4 d} \\ & = -\frac {3 b (2 a+b) \text {sech}(c+d x) \tanh (c+d x)}{8 d}-\frac {b \text {sech}^3(c+d x) \left (a+(a+b) \sinh ^2(c+d x)\right ) \tanh (c+d x)}{4 d}+\frac {\left (8 a^2+8 a b+3 b^2\right ) \text {Subst}\left (\int \frac {1}{1+x^2} \, dx,x,\sinh (c+d x)\right )}{8 d} \\ & = \frac {\left (8 a^2+8 a b+3 b^2\right ) \arctan (\sinh (c+d x))}{8 d}-\frac {3 b (2 a+b) \text {sech}(c+d x) \tanh (c+d x)}{8 d}-\frac {b \text {sech}^3(c+d x) \left (a+(a+b) \sinh ^2(c+d x)\right ) \tanh (c+d x)}{4 d} \\ \end{align*}

Mathematica [C] (warning: unable to verify)

Result contains higher order function than in optimal. Order 5 vs. order 3 in optimal.

Time = 7.31 (sec) , antiderivative size = 427, normalized size of antiderivative = 4.69 \[ \int \text {sech}(c+d x) \left (a+b \tanh ^2(c+d x)\right )^2 \, dx=-\frac {\text {csch}^3(c+d x) \left (128 \, _5F_4\left (\frac {3}{2},2,2,2,2;1,1,1,\frac {9}{2};-\sinh ^2(c+d x)\right ) \sinh ^6(c+d x) \left (a+a \sinh ^2(c+d x)+b \sinh ^2(c+d x)\right )^2+128 \, _4F_3\left (\frac {3}{2},2,2,2;1,1,\frac {9}{2};-\sinh ^2(c+d x)\right ) \sinh ^6(c+d x) \left (5 b^2 \sinh ^4(c+d x)+2 a b \sinh ^2(c+d x) \left (6+5 \sinh ^2(c+d x)\right )+a^2 \left (7+12 \sinh ^2(c+d x)+5 \sinh ^4(c+d x)\right )\right )+35 \left (b^2 \sinh ^4(c+d x) \left (1947+485 \sinh ^2(c+d x)\right )+2 a b \sinh ^2(c+d x) \left (2625+2554 \sinh ^2(c+d x)+485 \sinh ^4(c+d x)\right )+a^2 \left (3375+5907 \sinh ^2(c+d x)+3161 \sinh ^4(c+d x)+485 \sinh ^6(c+d x)\right )\right )-\frac {105 \text {arctanh}\left (\sqrt {-\sinh ^2(c+d x)}\right ) \left (b^2 \sinh ^4(c+d x) \left (649+378 \sinh ^2(c+d x)+9 \sinh ^4(c+d x)\right )+2 a b \sinh ^2(c+d x) \left (875+1143 \sinh ^2(c+d x)+389 \sinh ^4(c+d x)+9 \sinh ^6(c+d x)\right )+a^2 \left (1125+2344 \sinh ^2(c+d x)+1674 \sinh ^4(c+d x)+400 \sinh ^6(c+d x)+9 \sinh ^8(c+d x)\right )\right )}{\sqrt {-\sinh ^2(c+d x)}}\right )}{6720 d} \]

[In]

Integrate[Sech[c + d*x]*(a + b*Tanh[c + d*x]^2)^2,x]

[Out]

-1/6720*(Csch[c + d*x]^3*(128*HypergeometricPFQ[{3/2, 2, 2, 2, 2}, {1, 1, 1, 9/2}, -Sinh[c + d*x]^2]*Sinh[c +
d*x]^6*(a + a*Sinh[c + d*x]^2 + b*Sinh[c + d*x]^2)^2 + 128*HypergeometricPFQ[{3/2, 2, 2, 2}, {1, 1, 9/2}, -Sin
h[c + d*x]^2]*Sinh[c + d*x]^6*(5*b^2*Sinh[c + d*x]^4 + 2*a*b*Sinh[c + d*x]^2*(6 + 5*Sinh[c + d*x]^2) + a^2*(7
+ 12*Sinh[c + d*x]^2 + 5*Sinh[c + d*x]^4)) + 35*(b^2*Sinh[c + d*x]^4*(1947 + 485*Sinh[c + d*x]^2) + 2*a*b*Sinh
[c + d*x]^2*(2625 + 2554*Sinh[c + d*x]^2 + 485*Sinh[c + d*x]^4) + a^2*(3375 + 5907*Sinh[c + d*x]^2 + 3161*Sinh
[c + d*x]^4 + 485*Sinh[c + d*x]^6)) - (105*ArcTanh[Sqrt[-Sinh[c + d*x]^2]]*(b^2*Sinh[c + d*x]^4*(649 + 378*Sin
h[c + d*x]^2 + 9*Sinh[c + d*x]^4) + 2*a*b*Sinh[c + d*x]^2*(875 + 1143*Sinh[c + d*x]^2 + 389*Sinh[c + d*x]^4 +
9*Sinh[c + d*x]^6) + a^2*(1125 + 2344*Sinh[c + d*x]^2 + 1674*Sinh[c + d*x]^4 + 400*Sinh[c + d*x]^6 + 9*Sinh[c
+ d*x]^8)))/Sqrt[-Sinh[c + d*x]^2]))/d

Maple [A] (verified)

Time = 2.11 (sec) , antiderivative size = 134, normalized size of antiderivative = 1.47

method result size
derivativedivides \(\frac {2 a^{2} \arctan \left ({\mathrm e}^{d x +c}\right )+2 a b \left (-\frac {\sinh \left (d x +c \right )}{\cosh \left (d x +c \right )^{2}}+\frac {\operatorname {sech}\left (d x +c \right ) \tanh \left (d x +c \right )}{2}+\arctan \left ({\mathrm e}^{d x +c}\right )\right )+b^{2} \left (-\frac {\sinh \left (d x +c \right )^{3}}{\cosh \left (d x +c \right )^{4}}-\frac {\sinh \left (d x +c \right )}{\cosh \left (d x +c \right )^{4}}+\left (\frac {\operatorname {sech}\left (d x +c \right )^{3}}{4}+\frac {3 \,\operatorname {sech}\left (d x +c \right )}{8}\right ) \tanh \left (d x +c \right )+\frac {3 \arctan \left ({\mathrm e}^{d x +c}\right )}{4}\right )}{d}\) \(134\)
default \(\frac {2 a^{2} \arctan \left ({\mathrm e}^{d x +c}\right )+2 a b \left (-\frac {\sinh \left (d x +c \right )}{\cosh \left (d x +c \right )^{2}}+\frac {\operatorname {sech}\left (d x +c \right ) \tanh \left (d x +c \right )}{2}+\arctan \left ({\mathrm e}^{d x +c}\right )\right )+b^{2} \left (-\frac {\sinh \left (d x +c \right )^{3}}{\cosh \left (d x +c \right )^{4}}-\frac {\sinh \left (d x +c \right )}{\cosh \left (d x +c \right )^{4}}+\left (\frac {\operatorname {sech}\left (d x +c \right )^{3}}{4}+\frac {3 \,\operatorname {sech}\left (d x +c \right )}{8}\right ) \tanh \left (d x +c \right )+\frac {3 \arctan \left ({\mathrm e}^{d x +c}\right )}{4}\right )}{d}\) \(134\)
risch \(-\frac {b \,{\mathrm e}^{d x +c} \left (8 a \,{\mathrm e}^{6 d x +6 c}+5 b \,{\mathrm e}^{6 d x +6 c}+8 a \,{\mathrm e}^{4 d x +4 c}-3 b \,{\mathrm e}^{4 d x +4 c}-8 \,{\mathrm e}^{2 d x +2 c} a +3 b \,{\mathrm e}^{2 d x +2 c}-8 a -5 b \right )}{4 d \left ({\mathrm e}^{2 d x +2 c}+1\right )^{4}}+\frac {i \ln \left ({\mathrm e}^{d x +c}+i\right ) a^{2}}{d}+\frac {i b a \ln \left ({\mathrm e}^{d x +c}+i\right )}{d}+\frac {3 i b^{2} \ln \left ({\mathrm e}^{d x +c}+i\right )}{8 d}-\frac {i \ln \left ({\mathrm e}^{d x +c}-i\right ) a^{2}}{d}-\frac {i b \ln \left ({\mathrm e}^{d x +c}-i\right ) a}{d}-\frac {3 i b^{2} \ln \left ({\mathrm e}^{d x +c}-i\right )}{8 d}\) \(218\)

[In]

int(sech(d*x+c)*(a+b*tanh(d*x+c)^2)^2,x,method=_RETURNVERBOSE)

[Out]

1/d*(2*a^2*arctan(exp(d*x+c))+2*a*b*(-sinh(d*x+c)/cosh(d*x+c)^2+1/2*sech(d*x+c)*tanh(d*x+c)+arctan(exp(d*x+c))
)+b^2*(-sinh(d*x+c)^3/cosh(d*x+c)^4-1/cosh(d*x+c)^4*sinh(d*x+c)+(1/4*sech(d*x+c)^3+3/8*sech(d*x+c))*tanh(d*x+c
)+3/4*arctan(exp(d*x+c))))

Fricas [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 1373 vs. \(2 (85) = 170\).

Time = 0.26 (sec) , antiderivative size = 1373, normalized size of antiderivative = 15.09 \[ \int \text {sech}(c+d x) \left (a+b \tanh ^2(c+d x)\right )^2 \, dx=\text {Too large to display} \]

[In]

integrate(sech(d*x+c)*(a+b*tanh(d*x+c)^2)^2,x, algorithm="fricas")

[Out]

-1/4*((8*a*b + 5*b^2)*cosh(d*x + c)^7 + 7*(8*a*b + 5*b^2)*cosh(d*x + c)*sinh(d*x + c)^6 + (8*a*b + 5*b^2)*sinh
(d*x + c)^7 + (8*a*b - 3*b^2)*cosh(d*x + c)^5 + (21*(8*a*b + 5*b^2)*cosh(d*x + c)^2 + 8*a*b - 3*b^2)*sinh(d*x
+ c)^5 + 5*(7*(8*a*b + 5*b^2)*cosh(d*x + c)^3 + (8*a*b - 3*b^2)*cosh(d*x + c))*sinh(d*x + c)^4 - (8*a*b - 3*b^
2)*cosh(d*x + c)^3 + (35*(8*a*b + 5*b^2)*cosh(d*x + c)^4 + 10*(8*a*b - 3*b^2)*cosh(d*x + c)^2 - 8*a*b + 3*b^2)
*sinh(d*x + c)^3 + (21*(8*a*b + 5*b^2)*cosh(d*x + c)^5 + 10*(8*a*b - 3*b^2)*cosh(d*x + c)^3 - 3*(8*a*b - 3*b^2
)*cosh(d*x + c))*sinh(d*x + c)^2 - ((8*a^2 + 8*a*b + 3*b^2)*cosh(d*x + c)^8 + 8*(8*a^2 + 8*a*b + 3*b^2)*cosh(d
*x + c)*sinh(d*x + c)^7 + (8*a^2 + 8*a*b + 3*b^2)*sinh(d*x + c)^8 + 4*(8*a^2 + 8*a*b + 3*b^2)*cosh(d*x + c)^6
+ 4*(7*(8*a^2 + 8*a*b + 3*b^2)*cosh(d*x + c)^2 + 8*a^2 + 8*a*b + 3*b^2)*sinh(d*x + c)^6 + 8*(7*(8*a^2 + 8*a*b
+ 3*b^2)*cosh(d*x + c)^3 + 3*(8*a^2 + 8*a*b + 3*b^2)*cosh(d*x + c))*sinh(d*x + c)^5 + 6*(8*a^2 + 8*a*b + 3*b^2
)*cosh(d*x + c)^4 + 2*(35*(8*a^2 + 8*a*b + 3*b^2)*cosh(d*x + c)^4 + 30*(8*a^2 + 8*a*b + 3*b^2)*cosh(d*x + c)^2
 + 24*a^2 + 24*a*b + 9*b^2)*sinh(d*x + c)^4 + 8*(7*(8*a^2 + 8*a*b + 3*b^2)*cosh(d*x + c)^5 + 10*(8*a^2 + 8*a*b
 + 3*b^2)*cosh(d*x + c)^3 + 3*(8*a^2 + 8*a*b + 3*b^2)*cosh(d*x + c))*sinh(d*x + c)^3 + 4*(8*a^2 + 8*a*b + 3*b^
2)*cosh(d*x + c)^2 + 4*(7*(8*a^2 + 8*a*b + 3*b^2)*cosh(d*x + c)^6 + 15*(8*a^2 + 8*a*b + 3*b^2)*cosh(d*x + c)^4
 + 9*(8*a^2 + 8*a*b + 3*b^2)*cosh(d*x + c)^2 + 8*a^2 + 8*a*b + 3*b^2)*sinh(d*x + c)^2 + 8*a^2 + 8*a*b + 3*b^2
+ 8*((8*a^2 + 8*a*b + 3*b^2)*cosh(d*x + c)^7 + 3*(8*a^2 + 8*a*b + 3*b^2)*cosh(d*x + c)^5 + 3*(8*a^2 + 8*a*b +
3*b^2)*cosh(d*x + c)^3 + (8*a^2 + 8*a*b + 3*b^2)*cosh(d*x + c))*sinh(d*x + c))*arctan(cosh(d*x + c) + sinh(d*x
 + c)) - (8*a*b + 5*b^2)*cosh(d*x + c) + (7*(8*a*b + 5*b^2)*cosh(d*x + c)^6 + 5*(8*a*b - 3*b^2)*cosh(d*x + c)^
4 - 3*(8*a*b - 3*b^2)*cosh(d*x + c)^2 - 8*a*b - 5*b^2)*sinh(d*x + c))/(d*cosh(d*x + c)^8 + 8*d*cosh(d*x + c)*s
inh(d*x + c)^7 + d*sinh(d*x + c)^8 + 4*d*cosh(d*x + c)^6 + 4*(7*d*cosh(d*x + c)^2 + d)*sinh(d*x + c)^6 + 8*(7*
d*cosh(d*x + c)^3 + 3*d*cosh(d*x + c))*sinh(d*x + c)^5 + 6*d*cosh(d*x + c)^4 + 2*(35*d*cosh(d*x + c)^4 + 30*d*
cosh(d*x + c)^2 + 3*d)*sinh(d*x + c)^4 + 8*(7*d*cosh(d*x + c)^5 + 10*d*cosh(d*x + c)^3 + 3*d*cosh(d*x + c))*si
nh(d*x + c)^3 + 4*d*cosh(d*x + c)^2 + 4*(7*d*cosh(d*x + c)^6 + 15*d*cosh(d*x + c)^4 + 9*d*cosh(d*x + c)^2 + d)
*sinh(d*x + c)^2 + 8*(d*cosh(d*x + c)^7 + 3*d*cosh(d*x + c)^5 + 3*d*cosh(d*x + c)^3 + d*cosh(d*x + c))*sinh(d*
x + c) + d)

Sympy [F]

\[ \int \text {sech}(c+d x) \left (a+b \tanh ^2(c+d x)\right )^2 \, dx=\int \left (a + b \tanh ^{2}{\left (c + d x \right )}\right )^{2} \operatorname {sech}{\left (c + d x \right )}\, dx \]

[In]

integrate(sech(d*x+c)*(a+b*tanh(d*x+c)**2)**2,x)

[Out]

Integral((a + b*tanh(c + d*x)**2)**2*sech(c + d*x), x)

Maxima [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 199 vs. \(2 (85) = 170\).

Time = 0.29 (sec) , antiderivative size = 199, normalized size of antiderivative = 2.19 \[ \int \text {sech}(c+d x) \left (a+b \tanh ^2(c+d x)\right )^2 \, dx=-\frac {1}{4} \, b^{2} {\left (\frac {3 \, \arctan \left (e^{\left (-d x - c\right )}\right )}{d} + \frac {5 \, e^{\left (-d x - c\right )} - 3 \, e^{\left (-3 \, d x - 3 \, c\right )} + 3 \, e^{\left (-5 \, d x - 5 \, c\right )} - 5 \, e^{\left (-7 \, d x - 7 \, c\right )}}{d {\left (4 \, e^{\left (-2 \, d x - 2 \, c\right )} + 6 \, e^{\left (-4 \, d x - 4 \, c\right )} + 4 \, e^{\left (-6 \, d x - 6 \, c\right )} + e^{\left (-8 \, d x - 8 \, c\right )} + 1\right )}}\right )} - 2 \, a b {\left (\frac {\arctan \left (e^{\left (-d x - c\right )}\right )}{d} + \frac {e^{\left (-d x - c\right )} - e^{\left (-3 \, d x - 3 \, c\right )}}{d {\left (2 \, e^{\left (-2 \, d x - 2 \, c\right )} + e^{\left (-4 \, d x - 4 \, c\right )} + 1\right )}}\right )} + \frac {a^{2} \arctan \left (\sinh \left (d x + c\right )\right )}{d} \]

[In]

integrate(sech(d*x+c)*(a+b*tanh(d*x+c)^2)^2,x, algorithm="maxima")

[Out]

-1/4*b^2*(3*arctan(e^(-d*x - c))/d + (5*e^(-d*x - c) - 3*e^(-3*d*x - 3*c) + 3*e^(-5*d*x - 5*c) - 5*e^(-7*d*x -
 7*c))/(d*(4*e^(-2*d*x - 2*c) + 6*e^(-4*d*x - 4*c) + 4*e^(-6*d*x - 6*c) + e^(-8*d*x - 8*c) + 1))) - 2*a*b*(arc
tan(e^(-d*x - c))/d + (e^(-d*x - c) - e^(-3*d*x - 3*c))/(d*(2*e^(-2*d*x - 2*c) + e^(-4*d*x - 4*c) + 1))) + a^2
*arctan(sinh(d*x + c))/d

Giac [A] (verification not implemented)

none

Time = 0.32 (sec) , antiderivative size = 170, normalized size of antiderivative = 1.87 \[ \int \text {sech}(c+d x) \left (a+b \tanh ^2(c+d x)\right )^2 \, dx=\frac {{\left (\pi + 2 \, \arctan \left (\frac {1}{2} \, {\left (e^{\left (2 \, d x + 2 \, c\right )} - 1\right )} e^{\left (-d x - c\right )}\right )\right )} {\left (8 \, a^{2} + 8 \, a b + 3 \, b^{2}\right )} - \frac {4 \, {\left (8 \, a b {\left (e^{\left (d x + c\right )} - e^{\left (-d x - c\right )}\right )}^{3} + 5 \, b^{2} {\left (e^{\left (d x + c\right )} - e^{\left (-d x - c\right )}\right )}^{3} + 32 \, a b {\left (e^{\left (d x + c\right )} - e^{\left (-d x - c\right )}\right )} + 12 \, b^{2} {\left (e^{\left (d x + c\right )} - e^{\left (-d x - c\right )}\right )}\right )}}{{\left ({\left (e^{\left (d x + c\right )} - e^{\left (-d x - c\right )}\right )}^{2} + 4\right )}^{2}}}{16 \, d} \]

[In]

integrate(sech(d*x+c)*(a+b*tanh(d*x+c)^2)^2,x, algorithm="giac")

[Out]

1/16*((pi + 2*arctan(1/2*(e^(2*d*x + 2*c) - 1)*e^(-d*x - c)))*(8*a^2 + 8*a*b + 3*b^2) - 4*(8*a*b*(e^(d*x + c)
- e^(-d*x - c))^3 + 5*b^2*(e^(d*x + c) - e^(-d*x - c))^3 + 32*a*b*(e^(d*x + c) - e^(-d*x - c)) + 12*b^2*(e^(d*
x + c) - e^(-d*x - c)))/((e^(d*x + c) - e^(-d*x - c))^2 + 4)^2)/d

Mupad [B] (verification not implemented)

Time = 0.16 (sec) , antiderivative size = 303, normalized size of antiderivative = 3.33 \[ \int \text {sech}(c+d x) \left (a+b \tanh ^2(c+d x)\right )^2 \, dx=\frac {\mathrm {atan}\left (\frac {{\mathrm {e}}^{d\,x}\,{\mathrm {e}}^c\,\left (8\,a^2\,\sqrt {d^2}+3\,b^2\,\sqrt {d^2}+8\,a\,b\,\sqrt {d^2}\right )}{d\,\sqrt {64\,a^4+128\,a^3\,b+112\,a^2\,b^2+48\,a\,b^3+9\,b^4}}\right )\,\sqrt {64\,a^4+128\,a^3\,b+112\,a^2\,b^2+48\,a\,b^3+9\,b^4}}{4\,\sqrt {d^2}}-\frac {6\,b^2\,{\mathrm {e}}^{c+d\,x}}{d\,\left (3\,{\mathrm {e}}^{2\,c+2\,d\,x}+3\,{\mathrm {e}}^{4\,c+4\,d\,x}+{\mathrm {e}}^{6\,c+6\,d\,x}+1\right )}+\frac {4\,b^2\,{\mathrm {e}}^{c+d\,x}}{d\,\left (4\,{\mathrm {e}}^{2\,c+2\,d\,x}+6\,{\mathrm {e}}^{4\,c+4\,d\,x}+4\,{\mathrm {e}}^{6\,c+6\,d\,x}+{\mathrm {e}}^{8\,c+8\,d\,x}+1\right )}-\frac {{\mathrm {e}}^{c+d\,x}\,\left (5\,b^2+8\,a\,b\right )}{4\,d\,\left ({\mathrm {e}}^{2\,c+2\,d\,x}+1\right )}+\frac {{\mathrm {e}}^{c+d\,x}\,\left (9\,b^2+8\,a\,b\right )}{2\,d\,\left (2\,{\mathrm {e}}^{2\,c+2\,d\,x}+{\mathrm {e}}^{4\,c+4\,d\,x}+1\right )} \]

[In]

int((a + b*tanh(c + d*x)^2)^2/cosh(c + d*x),x)

[Out]

(atan((exp(d*x)*exp(c)*(8*a^2*(d^2)^(1/2) + 3*b^2*(d^2)^(1/2) + 8*a*b*(d^2)^(1/2)))/(d*(48*a*b^3 + 128*a^3*b +
 64*a^4 + 9*b^4 + 112*a^2*b^2)^(1/2)))*(48*a*b^3 + 128*a^3*b + 64*a^4 + 9*b^4 + 112*a^2*b^2)^(1/2))/(4*(d^2)^(
1/2)) - (6*b^2*exp(c + d*x))/(d*(3*exp(2*c + 2*d*x) + 3*exp(4*c + 4*d*x) + exp(6*c + 6*d*x) + 1)) + (4*b^2*exp
(c + d*x))/(d*(4*exp(2*c + 2*d*x) + 6*exp(4*c + 4*d*x) + 4*exp(6*c + 6*d*x) + exp(8*c + 8*d*x) + 1)) - (exp(c
+ d*x)*(8*a*b + 5*b^2))/(4*d*(exp(2*c + 2*d*x) + 1)) + (exp(c + d*x)*(8*a*b + 9*b^2))/(2*d*(2*exp(2*c + 2*d*x)
 + exp(4*c + 4*d*x) + 1))